package com.weimei.conversionTreasure.http.entity;

import com.google.gson.annotations.SerializedName;

import java.util.List;

public class CustomListBean extends BaseResult{

    @SerializedName("data")
    private List<DataDTO> data;

    public List<DataDTO> getData() {
        return data;
    }

    public void setData(List<DataDTO> data) {
        this.data = data;
    }

    public static class DataDTO {
        @SerializedName("id")
        private int id;
        @SerializedName("name")
        private String name;
        @SerializedName("telephone")
        private String telephone;
        @SerializedName("tradeNum")
        private int tradeNum;
        @SerializedName("totalAmount")
        private double totalAmount;
        @SerializedName("addtime")
        private String addtime;
        @SerializedName("tradeList")
        private List<TradeListDTO> tradeList;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getTelephone() {
            return telephone;
        }

        public void setTelephone(String telephone) {
            this.telephone = telephone;
        }

        public String getTradeNum() {
            return "交易"+tradeNum+"笔";
        }

        public void setTradeNum(int tradeNum) {
            this.tradeNum = tradeNum;
        }

        public String getTotalAmount() {
            return "总金额："+totalAmount;
        }

        public void setTotalAmount(double totalAmount) {
            this.totalAmount = totalAmount;
        }

        public String getAddtime() {
            return addtime;
        }

        public void setAddtime(String addtime) {
            this.addtime = addtime;
        }

        public List<TradeListDTO> getTradeList() {
            return tradeList;
        }

        public void setTradeList(List<TradeListDTO> tradeList) {
            this.tradeList = tradeList;
        }

        public static class TradeListDTO {
            @SerializedName("id")
            private int id;
            @SerializedName("addtime")
            private String addtime;
            @SerializedName("className")
            private String className;
            @SerializedName("amount")
            private double amount;

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getAddtime() {
                if (addtime.length()>=10){
                    return addtime.substring(0,10);
                }else {
                    return addtime;
                }
            }

            public void setAddtime(String addtime) {
                this.addtime = addtime;
            }

            public String getTypes() {
                return className;
            }

            public void setTypes(String types) {
                this.className = types;
            }

            public String getAmount() {
                return "-"+amount;
            }

            public void setAmount(double amount) {
                this.amount = amount;
            }
        }
    }
}
